<%--
  Created by IntelliJ IDEA.
  User: 王旭东
  Date: 2024/12/15
  Time: 12:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>登陆界面</title>
  <link rel="stylesheet" href="${pageContext.request.contextPath}\static\css\user\base.css">
  <style>
    body{ color:#333; font-size:13px;}
    input,select,textarea{color:#333;}
    .bg{ width:100%; height:100%; position:absolute; background:url(http://localhost:9080/AdoptMaster/static/images/login/bg.jpg) }
    .panel{background:#fff;}
    form .form-group:last-child{padding-bottom:0;}
    .passcode{position:absolute;right:0;bottom:0;height:32px;margin:1px;border-left:solid 1px #ddd;text-align:center;line-height:32px;border-radius:0 4px 4px 0;}
    ul,li{ list-style-type:none;}

    .field-icon-right .icon{ bottom:0px; top:auto}
    .loginbox { background:url(http://localhost:9080/AdoptMaster/static/images/login/tmbg-white.png); border:0px;}
    .mySize{
      width: 200px;
      height: 45px;
    }
  </style>
</head>
<body>
<div class="bg"></div>
<div class="container">
  <div class="line bouncein">
    <div class="xs6 xm4 xs3-move xm4-move">
      <div style="height:150px;"></div>
      <div class="media media-y margin-big-bottom">
      </div>
      <form action="${pageContext.request.contextPath}/admin/AdminLogin" method="post">
        <div class="panel loginbox">
          <div class="text-center margin-big padding-big-top">
            <h1>欢迎使用宠物领养管理系统</h1>
          </div>
          ${msg}
          <div class="panel-body" style="padding:30px; padding-bottom:10px; padding-top:10px;">
            <div class="form-group">
              <div class="field field-icon-right">
                <input type="text" class="input input-big" name="adminName" id="name" placeholder="账号" />
                <span class="icon icon-user margin-small"></span>
              </div>
            </div>
            <div class="form-group">
              <div class="field field-icon-right">
                <input type="password" class="input input-big" name="adminPwd" id="password" placeholder="密码" />
                <span class="icon icon-key margin-small"></span>
              </div>
            </div>
            <div class="form-group v_container">
              <div class="field">
                <input type="text" class="input input-big" id="code_input" name="code" placeholder="验证码" />
                <div id="v_container" style="width: 100px;height: 45px;" class="passcode"></div>
              </div>
            </div>
            <div style="padding:30px;">
              <input type="button" id="button" class="button button-block bg-main text-big input-big" value="登录">
            </div>
            <div style="padding:30px;">
              <input type="button" class="button button-block bg-main text-big input-big" value="客户页面"
                     onclick="location.href='${pageContext.request.contextPath}/user/index';">

            </div>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>

<script src="${pageContext.request.contextPath}/static/js/user/gVerify.js"></script>
<script>
  var verifyCode = new GVerify("v_container");

  document.getElementById("button").onclick = function () {

    // 获取input里面的值
    var res = verifyCode.validate(document.getElementById("code_input").value);
    if (res) {
      // 如果验证码正确，提交表单
      document.forms[0].submit();
    } else {
      alert("验证码错误");
      return false;
    }
  }
</script>
</body>
</html>
